home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ShareWare OnLine 2
/
ShareWare OnLine Volume 2 (CMS Software)(1993).iso
/
infor
/
ddj_more.zip
/
TOOLS.H
< prev
Wrap
Text File
|
1993-01-04
|
2KB
|
78 lines
/*----------------------------------------------------------------------*
* TOOLS.H: Various #defines and typedefs for GREP *
* *
* Copyright (c) 1984 by Allen Holub. All rights *
* reserved. *
*----------------------------------------------------------------------*
*/
/*
* #defines for non-printing ASCII characters
*/
#define NUL 0x00 /* ^@ */
#define CR 0x0d /* ^M */
#define SUB 0x1a /* ^Z */
#define CPMEOF SUB
#define islower(c) ('a'<=(c) && (c) <= 'z')
#define toupper(c) (islower(c) ? (c) - ('a' - 'A') : (c) )
#define max(x,y) ( ((x) < (y)) ? (y) : (x) )
/* Definitions of meta-characters used in pattern matching routines.
* LITCHAR & NCCL are only used as token identifers; all the others
* are also both token identifiers and the actual symbol used in
* the regular expression.
*/
#define BOL '^'
#define EOL '$'
#define ANY '.'
#define LITCHAR 'L'
#define ESCAPE '\\'
#define CCL '[' /* Character class: [....] */
#define CCLEND ']'
#define NEGATE '^'
#define NCCL '!' /* Negative character class [^...] */
#define CLOSURE '*'
#define OR_SYM '|'
/*
* Tokens are used to hold pattern templates. (see makepat() in
* tools.c
*/
typedef struct token
{
char tok;
char lchar;
char *bitmap;
struct token *next;
}TOKEN;
#define TOKSIZE sizeof(TOKEN)
/*
* An absolute maximum of strings.
*/
#define MAXSTR 132 /* Maximum number of characters in
* a line
*/
extern char *matchs();
extern char *amatch();
extern char *index();
extern TOKEN *getpat();
extern int esc();
extern char *dodash();
extern TOKEN *makepat();
extern int unmakepat();
extern int insert();
extern int delete();
extern int isalphanum();
extern char *stoupper();
extern int pr_tok();
extern int pr_line();